package cn.gson.springboot.model.service;
import org.springframework.beans.factory.annotation.Autowired; 
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSONArray;

import cn.gson.springboot.model.mapper.ypMapper;

@Service
@Transactional(rollbackFor=Exception.class)
public class ypserivce {
	
	@Autowired
	private  ypMapper ym;
	
	//查询中药
	public  JSONArray  zhongyao() {
		JSONArray chazhongyao = ym.chazhongyao();
		return chazhongyao;
	}
	//根据药品名字查中药
	public  JSONArray nameZhongyao(String drug_name) {
		JSONArray nameZhongyao = ym.nameZhongyao(drug_name);
		return nameZhongyao;
	}
	
	
	//查询西药
		public  JSONArray  xiyao() {
			JSONArray xiyao = ym.chaxiyao();
			return xiyao;
	}
		
	//根据药品名字查中药
	public  JSONArray nameXiyao(String drug_name) {
			JSONArray nameXiyao = ym.nameXiyao(drug_name);
			return nameXiyao;
	}
		
	//根据药id查询药品
	public JSONArray idyao(Integer drug_id) {
		JSONArray idyao = ym.idyao(drug_id);
		return idyao;
	}
	
	
		
}
